Shader "VRP/VRP_lit"
{
    Properties
    {
        [MainColor] _BaseColor("Color", Color) = (1, 1, 1, 1)
        _Smoothness("Smoothness",Range(0,1))=0
        _Metallic("Metallic",Range(0,1))=0
        //开关是否开启多光源效果
        [Toggle(_AdditionalLights)] _AddLights ("AddLights", Float) = 1
        [Toggle(_RECEIVE_SHADOWS_OFF)] _RECEIVE_SHADOWS_OFF ("Receive Shadows Off", int) = 0
        [Toggle(V_SHADOW_PCF)] V_SHADOW_PCF ("PCF", Int) = 1
        [Toggle(_MULTISCATTERING)] _EnergyConservationToggle ("Energy Conservation using Kulla-Conty method", Int) = 0
        [Toggle(_NOSpecularactor)] _NOSpecularactor ("_NOSpecularactor", Int) = 0
        [Toggle(_NOIBL)] _NOIBL ("_NOIBL", Int) = 0
        
        [Space (20)]
    	[Toggle(_CLEARCOAT)]  _CLEARCOAT ("Clear Coat", Int) = 0
    	_ClearCoat("ClearCoat",Range(0.0, 1.0)) = 0
    	_ClearCoatStrength ("ClearCoat Strength", Range(0.0, 1.0)) = 0
    	_ClearCoatRoughness ("ClearCoat Roughness", Range(0.0, 1.0)) = 0.1

    }

    SubShader
    {
        Tags { "RenderType"="Opaque" "LightMode" = "VRP_lit" 
//                "RenderPipeline"="UniversalPipeline"
        }
        LOD 100

        Pass
        {
            
            ZTest  LEqual
            ZWrite On
            HLSLPROGRAM

            #pragma target 4.5

            #pragma vertex vert
            #pragma fragment frag
            #pragma enable_cbuffer

            #pragma multi_compile _ V_SHADOW_PCF
            #pragma shader_feature _AdditionalLights
            #pragma shader_feature _RECEIVE_SHADOWS_OFF
            #pragma multi_compile _ _CLEARCOAT
            #pragma multi_compile _MULTISCATTERING
            #pragma multi_compile_local _ _NOSpecularactor
            #pragma multi_compile_local _ _NOIBL
            #include "ShaderLib/VRP_litPass.hlsl"

            ENDHLSL
        }
       
        Pass
        {
            Name "ShadowCaster"
            Tags{"LightMode" = "ShadowCaster"}
            
            ZWrite On
            ColorMask 0
            
            HLSLPROGRAM
            #pragma target 4.5
            #pragma vertex DepthOnlyVertex
            #pragma fragment DepthOnlyFragment

        
           

            #include "Shaders/VLitInput.hlsl"
            #include "ShaderLib/VDepthonlyPass.hlsl"
            ENDHLSL
        }
    }
}